<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/10/28
 * Time: 15:36
 */

namespace app\MAPP\shop\ctl;


use app\MAPP\shop\mode\lists\func as lis;
use function core\alert;
use function core\backto2;
use core\lib\BaseControlerDB;
use function core\p;
use Extentions\template\Template;

class indexmc extends BaseControlerDB
{
    var $mode;
    function __USERFUNC()
    {
        $this->mode = new lis();
        if (!($this->msg->ip == "::1" || $this->msg->ip=="127.0.0.1")){
            backto2("/run/index/index");
        }
    }

    function index($page = 0){
        if (is_null($page)){$page = 0;}
        $tpl = Template::Newinstance();
        $tpl->displayN("bar.php",__DIR__);
        $tmp = $this->mode->lists($page);
        $tpl->assign("data",date("Y M D h:m:s"));
        $tpl->assign("shop",$tmp);
        $tpl->assign("pagen",$page+10);
        if (($page-10)<0){
            $tpl->assign("pageb",0);
        }else{
            $tpl->assign("pageb",$page-10);
        }
        $tpl->assign("page",(int)$page/10);
        $tpl->displayFd("shoping.php",__DIR__);
    }

}